#ifndef CLIENT_XML_READER_H
#define CLIENT_XML_READER_H

#include <QtXml>
#include <QIODevice>
#include "client.h"

class ClientXmlReader : QObject
{
	Q_OBJECT
public:
	ClientXmlReader(QIODevice *data, Client *clientRef);
//	~clientXmlReader();
	bool leggi();
private:
	Client *client;
	QIODevice *data;

};

class ClientHandler : public QXmlDefaultHandler
{
public:
	ClientHandler(Client *client);
	bool startElement(const QString &namespaceURI, const QString &localName,
                       const QString &qName, const QXmlAttributes &attributes);
    bool endElement(const QString &namespaceURI, const QString &localName,
                     const QString &qName);
    bool characters(const QString &str);
    bool fatalError(const QXmlParseException &exception);
    QString getErrorString();
private:
	Client *clientRef;
	bool startMet;
	bool inGetLogs;
	quint16 getLogsPort;
	QString errorString;
	QString currentText;
	QStringList *logList;

};

#endif